import { IToolTip } from "../../../../../com/mui/manager/IToolTip";
import { ObjCreate } from "../ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GImageBitmap } from "../../../../../com/mui/controls/GImageBitmap";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ImageTitleToolTipData } from "./itemData/ImageTitleToolTipData";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class ImageTitleToolTip
    
    export  class ImageTitleToolTip /* flash.display.Sprite */ implements IToolTip
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            this._bg = ObjCreate.createBg(0, 0, 165, 180, this, ImagesConst.ToolTipBg);
            this._titlePic = new GImageBitmap();
            ObjCreate.setObjAttri(this._titlePic, 20, 10, -1, -1, this);
            this._tip = ObjCreate.createGTextField("", 10, 50, 220, -1, this, GlobalStyle.setTextFormatLeading(GlobalStyle._textFormat9, 8));
            this._tip.wordWrap = true;
            this._tip.multiline = true;
            return;
        }

        /* internal  */initView(): void
        {
            this._titlePic.imgUrl = this._tipData.title;
            this._tip.htmlText = this._tipData.tip;
            this._tip.height = this._tip.textHeight + 10;
            this._bg.height = this._tip.textHeight + 60;
            return;
        }

        public set data(arg1)
        {
            this._tipData = arg1 as ImageTitleToolTipData;
            this.initView();
            return;
        }

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_titlePic: GImageBitmap;

        /* internal */ /* var */_tip: GTextFiled;

        /* internal */ /* var */_tipData: ImageTitleToolTipData;
    }
